﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace JHQC
{
    public partial class ProdView : UserControl
    {
        private void SetStatus(StatusEnum status)
        {
            if (status == StatusEnum.Ok)
                this.BackColor = Color.Green;
            if (status == StatusEnum.Waiting)
                this.BackColor = Color.DarkGray;
            if (status == StatusEnum.NotOk)
                this.BackColor = Color.DarkRed;
            if (status == StatusEnum.Cancle)
                this.BackColor = Color.DarkOrange;
        }
        public void SetItem(OptItem item)
        {
            this.label1.Text = item.ToViewStr();
            SetStatus(item.Status);
        }
        public ProdView()
        {
            InitializeComponent();
        }
    }
}
